Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SCP-4387 Re organize isabelle semantic types to become literal programming #134

Merged
merged 5 commits into from
Sep 21, 2022

Conversation

hrajchert
Copy link
Collaborator

@hrajchert hrajchert commented Sep 8, 2022

Given the limitations of Isabelle antiquotes, we decided to modify the organization of the proofs so that they are self documenting and part of the specification.

I attach specification-v3.pdf an exported pdf of the specification

I attach the specification-v3.pdf, modified after @bwbush suggestions.

I attach the specification-v3.pdf, modified after @bwbush and @palas suggestions.

@hrajchert hrajchert requested review from bwbush and palas September 8, 2022 21:16
@@ -367,29 +258,79 @@ and Contract = Close
| Let ValueId Value Contract
| Assert Observation Contract

type_synonym Accounts = "((AccountId \<times> Token) \<times> Money) list"
text \<open>@{term Close} is the simplest contract, when we evaluate it, the execution is completed and we
generate \<^term>\<open>Payment\<close>s \secref{TODO} for the assets in the internal accounts to their default owners
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing cross-reference.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, this depends on wether we move Payment here, or if we split types into DSL and Execution




\<comment> \<open>TODO: see if we want to add data types of Semantic here (Transaction, etc) or if we want to
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps we could collect all of the error and warning types in a new section here?

record Environment = timeInterval :: TimeInterval
text \<open>FIXME: Print record:
@{term [names_short, margin=40]TimeInterval}
\<close>

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

text \<open>FIXME: Print record: @{term [names_short, margin=40]Transaction}

We could eliminate this problem by moving this section into Core and making it literate there.

Copy link
Collaborator

@bwbush bwbush left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suggested changes in #136. (Was there a way to get those PR changes to show up in this PR?)

So is the plan to move parts of Doc/Core.thy into Core/*.thy so things like the records and code excerpts appear?

@hrajchert
Copy link
Collaborator Author

hrajchert commented Sep 12, 2022

I suggested changes in #136. (Was there a way to get those PR changes to show up in this PR?)

So is the plan to move parts of Doc/Core.thy into Core/*.thy so things like the records and code excerpts appear?

Yes, that would be SCP-4443: Re-organize Isabelle Semantic to become literal programming. I changed the scope of this to only refactor the types so that it wasn't such a big change (it ended up being anyways 😅)

@hrajchert hrajchert mentioned this pull request Sep 13, 2022
Copy link
Collaborator

@palas palas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you, it is looking good. I have written a series of pretty pedantic changes. I am not 100% sure all of them are necessary, but I tried to make some things more precise and accurate, add consistency, and fix typos. Also some may not be due to this PR, because some code was moved and I didn't realise, sorry in advance, but still probably good to fix them

value using an identifier @{term i}. In this case, the expression @{term v} is
evaluated, and stored with the name @{term i}. The contract then continues as
@{term c}. As well as allowing us to use abbreviations, this mechanism also means that we
can capture and save volatile values that might be changing with time, e.g. the current price of
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
can capture and save volatile values that might be changing with time, e.g. the current price of
can capture and save volatile values that might be changing with time, e.g.~the current price of

That is how you prevent the extra space after a stop in LaTeX, I hope it works here too

@hrajchert hrajchert requested a review from palas September 21, 2022 18:34
@hrajchert hrajchert merged commit 4f9fa24 into master Sep 21, 2022
@palas palas deleted the hrajchert/scp-4387-literate-programming branch October 28, 2022 15:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants